<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <form id="role-form">
                <input type="hidden" name="userid" value="<?=$input['userid']??''?>">
            </form>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>
<?php $this->beginBlock('script'); ?>
<script>
    $(function () {
        bootUrl.url = "<?=\yii\helpers\Url::toRoute('water')?>"
        var options = {
            modalName: "流水记录",
            sortName:'create_time',
            sortOrder: "desc",
            type:0,
            columns: [
                {field: 'id', title: 'ID',  sortable: true},
                {
                    title: '类型',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var html = '<span class="label label-warning"> - </span>';
                        if (row.add_sub==1){
                            html = '<span class="label label-info"> + </span>';
                        }
                        return html;
                    }
                },
                {field: 'front', title: '变化前'},
                {field: 'after', title: '变化后'},
                {field: 'amount', title: '金额'},
                {field: 'use', title: '用途'},
                {field: 'remarks', title: '备注'},
                {field: 'create_time', title: '时间'},
            ]
        };
        $.table.init(options);
    });
</script>
<?php $this->endBlock(); ?>

